let http = require('http');

let server = http.createServer();

server.on('request', (req, res) => {
  console.log('req, event')
  res.writeHead( 200, {'Content-Type': 'text/plain'})
  res.end('Hello world')
})

server.on('connection', () => {
  console.log('connection event')
})

server.listen( 3000, () => {
  console.log( 'listening event' )
})

console.log('服务运行中：3000')